<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <title>用户: ${this.user.fullName}</title>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li><g:link controller="user" action="index">用户管理</g:link></li>
                    <li class="active">
                        <span>${this.user.fullName}</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                用户: ${this.user.fullName}
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                <div class="panel-tools">
                <g:link class="btn btn-info btn-xs" action="edit" resource="${this.user}"><i class="fa fa-edit"></i>编辑</g:link>
                    <g:link class="btn btn-info btn-xs" action="resetPassword" resource="${this.user}"><i class="fa fa-edit"></i>重置密码</g:link>
                </div>
                用户基本信息
            </div>

            <div class="panel-body">
                <div class="text-muted font-bold m-b-xs ol-md-6">
                    <div class="col-md-12"><h4><a href=>${this.user.fullName}</a></h4></div>
                    <div class="col-md-2" style="width: 14.2%"><strong>手机号：${this.user.cellphone}</strong></div>
                    <div class="col-md-2" style="width: 14.2%"><strong>账号状态：${this.user?.enabled ? '启用' : '禁用'}</strong></div>
                    <div class="col-md-2" style="width: 14.2%"><strong>所属机构：${this.user?.account?.name}</strong></div>
                    <div class="col-md-2" style="width: 14.2%"><strong>所属部门：${this.user?.department?.name}</strong></div>
                    <div class="col-md-2" style="width: 14.5%"><strong>账号有效期：<g:if test="${this.user?.expiredDate}"><g:formatDate date="${this.user?.expiredDate}" format="yyyy-MM-dd HH:mm:ss"></g:formatDate></g:if></strong></div>
                    <div class="col-md-2" style="width: 14.2%"><strong>主题色：${this.user?.skin?'深色':'浅色'}</strong></div>
                    <div class="col-md-2" style="width: 14.5%"><strong>首页配置：${this.user?.profile?.name}</strong></div>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                <div class="panel-tools">
                    <g:link controller="userRole" action="create" id="${this.user.id}" class="btn btn-info btn-xs">增加授权</g:link>
                    <a class="showhide"><i class="fa fa-chevron-up"></i></a>
                </div>
                用户角色
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <tbody>
                        <g:each in="${userRoleList}" var="r">
                            <tr>
                                <td>${r.role.name}</td>
                                <td width="6%">
                                    <sec:ifAllGranted roles="ROLE_ADMINISTRATOR">
                                        <g:link action="deleteRole" params="[userId: r.user.id, roleId: r.role.id]" class="btn btn-danger btn-block btn-xs btn-block">取消授权</g:link>
                                    </sec:ifAllGranted>
                                </td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
